#ifndef MYTHREADPOOL_H
#define MYTHREADPOOL_H

#include <QRunnable>
#include <QDebug>
#include <QThread>
#include <qobject.h>
#include "logentry.h"
#include "common_define.h"

class TaskNotifier : public QObject
{
    Q_OBJECT

public:
    explicit TaskNotifier(QString attr,QObject * parent = nullptr):QObject(parent),m_attritube(attr),m_stauts(TASK_NONE){}

    QString get_attr(){ return m_attritube;}

    void set_status(TASK_STATUS status){ m_stauts = status;}
    TASK_STATUS get_status(){ return m_stauts;}
signals:
    void taskFinished(TASK_STATUS,QString);
    void taskLineInfo(QVector<LogEntry>);

private:
    QString m_attritube;
    TASK_STATUS m_stauts;
};



class LoadFileTask : public QRunnable
{
public:
    explicit LoadFileTask(TaskNotifier* notifier) : m_notifier(notifier) {}

    void run() override;

private:
    TaskNotifier* m_notifier;
};

#endif // MYTHREADPOOL_H
